<h2>Application <%= @kind == 'ao' ? 'Originated' : 'Terminated' -%> Message #<%= @msg.id -%></h2>

<h4><%= link_to_function 'Log', "toggle('log')" -%></h4>

<div id="log">
<table border="1" class="table">
  <tr>
    <th>When</th>
    <th>Severity</th>
    <th>Text</th>
  </tr>
  <tr>
  <%- @logs.each_with_index do |log, i| -%>
    <tr class="<%= i.even_to_s -%>">
      <td><%= time_ago log.created_at -%></td>
      <td><%= log.severity_html.html_safe -%></td>
      <td><%= log.message.gsub("\n", "<br/>").html_safe rescue '' -%></td>
    </tr>
  <%- end -%>
</table>
</div>

<%= render 'messages/message', :msg => @msg, :title => 'Message', :log => nil -%>
